*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE 1

***************************

cd ""

use "DTA files/Dataset", clear

global horizon1 6
global horizon2 5

********************* Prepare data *******************

* Create matrix where to store responses to EPL reforms
matrix change2 = J($horizon1+$horizon2,4,.)

* Create country aggregate labor share variable - for the different samples 
egen va_country = total(va) if va != ., by(country year)
egen lab_country = total(lab) if lab != ., by(country year)
gen ac0 = 100*lab_country/va_country

* Set panel
xtset id_cross_section year

* GRAPH 

forvalues a = 0/0 {
forvalues i = 1/$horizon1 {
gen ac_d`i'= ac`a'[_n+1-`i']-ac`a'[_n] if id_cross_section==id_cross_section[_n-`i']
quietly sum ac_d`i' if EPLregularworkers==1  & id_industry == 1, detail  /* change during positive reform */ 
local sc1 = r(mean)
quietly sum ac_d`i' if EPLregularworkers==0  & id_industry == 1, detail /* change in non-reforming countries during reform-years */ 
local sc2 = r(mean)
matrix change2[$horizon1+1-`i',1] = `sc1'
matrix change2[$horizon1+1-`i',2] = `sc2'
} 

forvalues i = 1/$horizon2 {
gen ac_f`i' = f`i'.ac`a'-ac`a'
quietly sum ac_f`i' if EPLregularworkers==1 & id_industry == 1, detail
local sc1 = r(mean)
quietly sum ac_f`i' if EPLregularworkers==0 & id_industry == 1, detail
local sc2 = r(mean)
matrix change2[$horizon1+`i',1] = `sc1'
matrix change2[$horizon1+`i',2] = `sc2'
} 
}

svmat change2
gen time = _n
replace time = time - $horizon1
replace time = . if time > $horizon2

graph twoway line change21 change22 time, xsize(10) ysize(5) lwidth(thick thick) lpattern(solid dash) lcolor(green red)  xline(0,lcolor(black) ) yline(0, lcolor(black)) ylabel(-2(1)0.5, grid) graphregion(color(white)) ytitle("") xlab(-5(1)5) xtitle("") legend(label(1 "Reforming countries") label(2 "Status quo countries") size(medlarge))
graph export "Figures/1.png", replace
